//
//  FHNewClassHeadView.m
//  ZhiXinFM
//
//  Created by lanou3g on 15/7/18.
//  Copyright (c) 2015年 YITeam. All rights reserved.
//

#import "FHNewClassHeadView.h"

@implementation FHNewClassHeadView
+ (instancetype)newClassWithtablView:(UITableView *)tableview{
    static NSString *newClass=@"Class";
    FHNewClassHeadView *headNewClass=[tableview dequeueReusableCellWithIdentifier:newClass];
    if (headNewClass==nil) {
        headNewClass=[[FHNewClassHeadView alloc]initWithReuseIdentifier:newClass];
    }
    return headNewClass;
}
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithReuseIdentifier:reuseIdentifier]) {
        UIButton *BtnClas=[[UIButton alloc]init];
        [self.contentView addSubview:BtnClas];
        self.classBtn=BtnClas;
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.classBtn.frame=self.bounds;
    self.classBtn.backgroundColor=[UIColor orangeColor];
    UIImageView *imageicon=[[UIImageView alloc]init];
    [self.classBtn addTarget:self action:@selector(jump) forControlEvents:UIControlEventTouchUpInside];
    [self.classBtn setTitle:@"最新心理课" forState:UIControlStateNormal];
    [self.classBtn setTintColor:[UIColor blackColor]];
    self.classBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    self.classBtn.contentEdgeInsets=UIEdgeInsetsMake(0, 20, 0, 0);
    imageicon.frame=CGRectMake(340, 10, 15, 15);
    imageicon.image=[UIImage imageNamed:@"broad"];
    [self.classBtn addSubview:imageicon];
}
- (void)jump{
    NSLog(@"sss");
}
@end
